package com.example.day2.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.day2.R;
import com.example.day2.entity.GoodsResult;

public class GoodsAdapter extends BaseQuickAdapter<GoodsResult.DataBean , BaseViewHolder> {
    public GoodsAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, GoodsResult.DataBean dataBean) {
        baseViewHolder.setText(R.id.tv,dataBean.getGoods_desc());
        baseViewHolder.setText(R.id.tv2,"价格"+dataBean.getGoods_default_price()+"元");
        ImageView view = baseViewHolder.getView(R.id.iv);
        Glide.with(getContext()).load(dataBean.getGoods_default_icon()).into(view);
    }
}
